home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / Menu Sharing Toolkit / menusharing.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-11  |  2.0 KB  |  83 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1992 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4.  
  5. #ifndef __APPLEEVENTS__
  6.  
  7.     #include <AppleEvents.h>
  8.  
  9. #endif
  10.  
  11.  
  12. #define __MENUSHARING__ /*so other modules can tell that we've been included*/
  13.  
  14.  
  15.  
  16. typedef struct tysharedmenurecord { /*must match scripting system record structure*/
  17.     
  18.     short idmenu; /*the resource id of the menu*/
  19.     
  20.     int flhierarchic: 1; /*if true it's a hiearchic menu*/
  21.     
  22.     int flinserted: 1; /*if true the menu has been inserted in the menu bar*/
  23.     
  24.     MenuHandle hmenu; /*a handle to the Mac Menu Manager's data structure*/
  25.     } tysharedmenurecord;
  26.  
  27.  
  28. typedef tysharedmenurecord tymenuarray [1];
  29.  
  30. typedef tymenuarray **hdlmenuarray;
  31.  
  32. typedef pascal Boolean (*tyMScallback) (void);
  33.  
  34.  
  35. typedef struct tyMSglobals { /*Menu Sharing globals, all in one struct*/
  36.  
  37.     OSType serverid; /*identifier for shared menu server*/
  38.  
  39.     OSType clientid; /*id of this application*/
  40.     
  41.     hdlmenuarray hsharedmenus; /*data structure that holds shared menus*/
  42.     
  43.     Boolean fldirtysharedmenus; /*if true, menus are reloaded next time app comes to front*/
  44.     
  45.     Boolean flscriptcancelled; /*set true by calling CancelSharedScript*/
  46.     
  47.     Boolean flscriptrunning; /*true if a script is currently running*/
  48.     
  49.     tyMScallback scriptcompletedcallback; /*if non-nil, it's called when the script completes*/
  50.     
  51.     long idscript; /*the server's id for the currently running script, makes it easy to kill it*/
  52.     } tyMSglobals;
  53.  
  54.  
  55. extern tyMSglobals MSglobals; /*menu sharing globals*/
  56.  
  57.  
  58. /*basic Menu Sharing routines*/
  59.  
  60.     pascal Boolean InitSharedMenus (void);
  61.  
  62.     pascal Boolean SharedMenuHit (short, short);
  63.     
  64.     pascal Boolean SharedScriptRunning (void);
  65.     
  66.     pascal Boolean CancelSharedScript (void);
  67.     
  68.     pascal Boolean CheckSharedMenus (short);
  69.     
  70.     pascal Boolean SharedScriptCancelled (AppleEvent *, AppleEvent *);
  71.     
  72.  
  73. /*special-purpose routines*/
  74.  
  75.     pascal Boolean DisposeSharedMenus (void);
  76.  
  77.     pascal Boolean IsSharedMenu (short);
  78.     
  79.     pascal Boolean EnableSharedMenus (Boolean);
  80.     
  81.     pascal Boolean RunSharedMenuItem (short, short);
  82.     
  83.